import {leftMenus} from "network/homeRequest/HomeRequest";

import * as Methods from '../methods.const';

const state = {

  leftMenus:null

};

const mutations = {

  [Methods.SAVE_LEFT_MENU](state,data){

    state.leftMenus = data;
  }

}

const actions = {

  [Methods.GET_Left_Menu](content){

    return new Promise((resolve,reject)=>{

      leftMenus({}).then(data=>{

        content.commit(Methods.SAVE_LEFT_MENU,data);
        resolve(data);
      }).catch(error=>{

        reject(error);
      });

    });

  }

}


export default {

  state,
  mutations,
  actions
}
